<%@ page import="com.psl.model.userlogin" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    userlogin userinfo = (userlogin) session.getAttribute("user");
    if (userinfo == null) {
        response.sendRedirect("/login.do");
    }%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/assets/css/text.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/main.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/content.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="/assets/js/common.js"></script>
    <script language="javascript" src="/assets/js/general.js"></script>
    <script language="JavaScript" type="text/JavaScript">
    </script>
    <style>
        #title {
            width: 92%;
            border: 0px;
            margin-bottom: 10px;
        }

        #title td {
            text-align: center;
            height: 20px;
            line-height: 150%
        }

        #title div {
            background-image: url(/assets/img/dot_02.gif);
            background-position: left top;
            background-repeat: no-repeat;
            margin: 0 auto;
            padding-left: 20px;
            text-align: left;
            width: 10%;
            font-size: 15px;
            font-weight: bold;
            color: #CC0000;
            letter-spacing: 2px;
        }
    </style>
</head>
<body>

<table cellspacing="0" cellpadding="0" id="title" align="center">
    <tbody>
    <tr>
        <td nowrap="nowrap">
            <div> 发货清单</div>
        </td>
    </tr>
    </tbody>
</table>

<table cellpadding="0" cellspacing="0" class="datalist" align="center">
    <tr>
        <th colspan="1">编号</th>
        <th colspan="1">名称</th>
        <th colspan="1">规格</th>
        <th colspan="1">操作</th>
    </tr>
    <form action="/gethname3.do" method="post">
        <tr>
            <td align="center" colspan="1"></td>
            <td align="center" colspan="1"><input name="h_name" type="text" value=""></td>
            <td align="center" colspan="1"><input name="h_size" type="text" value=""></td>
            <td align="center" colspan="1"><input type="submit" value="查询"/></td>
        </tr>
    </form>
    <c:if test="${not empty query}">
        <c:forEach items="${query}" var="q" varStatus="status">
            <script>
                function add${status.count}() {
                    document.getElementById("h_no").value = document.form${status.count}.no.value;
                    document.getElementById("h_name").value = document.form${status.count}.name.value;
                    document.getElementById("h_size").value = document.form${status.count}.size.value;
                }
            </script>
            <form name="form${status.count}">
                <tr class="change">
                    <td align="center" colspan="1"><input type="hidden" id="no${status.count}" name="no"
                                                          value="${q.h_no}"/> ${q.h_no}</td>
                    <td align="center" colspan="1"><input type="hidden" id="name${status.count}" name="name"
                                                          value="${q.h_name}"/>${q.h_name}</td>
                    <td align="center" colspan="1"><input type="hidden" id="size${status.count}" name="size"
                                                          value="${q.h_size}"/>${q.h_size}</td>
                    <td align="center" colspan="1"><input type="button" value="添加" onclick="add${status.count}()"/></td>
                </tr>
            </form>
        </c:forEach>
    </c:if>
    </tbody>
</table>
<br>
<br>

<table cellspacing="0" cellpadding="0" class="datalist" align="center">
    <form action="/sellupload.do" method="post">
        <tr>
            <td align="center" colspan="1"><input type="submit" value="上传发货清单"/></td>
    </form>
    <form action="/sellIn.do" method="post">
        <td align="center" colspan="1"><input type="submit" value="保存"/></td>
        <td align="center" colspan="13"></td>
        </tr>
        <tr>
            <th align="center">操作</th>
            <th align="center">序号(自动生成)</th>
            <th height="25" align="center">产品编码</th>
            <th height="25" align="center">产品名称</th>
            <th align="center">规格</th>
            <th align="center">商标</th>
            <th align="center">压力</th>
            <th align="center">数量</th>
            <th align="center">单位</th>
            <th align="center">送货日期</th>
            <th align="center">客户单位</th>
            <th align="center">发货凭条编号(自动生成)</th>
            <th align="center">包装</th>
            <th align="center">备注</th>
        </tr>
        <tr>
            <td height="25" align="center"></td>
            <td height="25" align="center"></td>
            <td height="25" align="center"><input name="h_no" id="h_no" type="text" value=""></td>
            <td height="25" align="center"><input name="h_name" id="h_name" type="text" value=""></td>
            <td height="25" align="center"><input name="h_size" id="h_size" type="text" value=""></td>
            <td height="25" align="center">
                <jsp:include page="R.jsp"/>
            </td>
            <td height="25" align="center">
                <jsp:include page="PN.jsp"/>
            </td>
            <td height="25" align="center"><input name="h_num" id="h_num" type="number" value=""></td>
            <td height="25" align="center">
                <input type="text" value="" name="h_unit" placeholder="单位"></td>
            <td height="25" align="center"><input type="date" name="h_senddate" value=""></td>
            <td height="25" align="center">
                <jsp:include page="custom.jsp"/>
            </td>
            <td height="25" align="center"><input type="hidden" name="h_ticketno" value="1"></td>
            <td height="25" align="center">
                <select name="usepackage">
                    <option value="散装">散装</option>
                    <option value="箱装">箱装</option>
                </select>
            </td>
            <td height="25" align="center"><input type="text" name="remark" value=""></td>
            <td height="25" align="center">
            </td>
        </tr>
    </form>
    <c:forEach items="${Allselllist}" var="s">
        <tr>
            <td height="25" align="center"><a href="/sellview.do?h_ticketno=${s.h_ticketno}" target="_blank"><img
                    src="/assets/img/view.gif"></a><a href="/delsell.do?id=${s.id}"><img src="/assets/img/icodelete.gif"></a></td>
            <td height="25" align="center">${s.id}</td>
            <td height="25" align="center">${s.h_no}</td>
            <td height="25" align="center">${s.h_name}</td>
            <td height="25" align="center">${s.h_size}</td>
            <td height="25" align="center">${s.h_r}</td>
            <td height="25" align="center">${s.h_n}</td>
            <td height="25" align="center">${s.h_num}</td>
            <td height="25" align="center">${s.h_unit}</td>
            <td height="25" align="center">${s.h_senddate}</td>
            <td height="25" align="center">${s.c_name}</td>
            <td height="25" align="center">${s.h_ticketno}</td>
            <td height="25" align="center">${s.usepackage}</td>
            <td height="25" align="center"><input type="text" value="${s.remark}" disabled/></td>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>